package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;

/**
 * @Auther: zh
 * @Date: 2025/6/2 - 06 - 02 - 11:16
 * @Description: com.sky.mapper
 * @version: 2.1
 */
@Mapper
public interface OrderDetailMapper {


    /**
     * 向订单明细表插入n条数据
     * @param orderDetailList
     */
    void insertBatch(ArrayList<OrderDetail> orderDetailList);

    /**
     * 根据订单id查询订单明细
     * @param ordersId
     * @return
     */
    @Select("select *from order_detail where order_id = #{ordersId}")
    List<OrderDetail> getByOrdersId(Long ordersId);


}
